<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>信用卡申请</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f4f4f4;
      margin: 0;
      padding: 0;
    }

    .header {
      background-color: #007bff;
      color: white;
      text-align: center;
      padding: 1em;
    }

    .container {
      padding: 20px;
    }

    .form-container {
      background-color: white;
      padding: 20px;
      border-radius: 5px;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .form-group {
      margin-bottom: 15px;
    }

    .form-group label {
      display: block;
      margin-bottom: 5px;
      font-weight: bold;
    }

    .form-group input,
    .form-group select {
      width: 100%;
      padding: 10px;
      border: 1px solid #ccc;
      border-radius: 5px;
    }

    .button {
      background-color: #007bff;
      color: white;
      border: none;
      padding: 10px 15px;
      border-radius: 5px;
      cursor: pointer;
      text-decoration: none;
    }

    .button:hover {
      background-color: #0056b3;
    }

    .back-link {
      display: inline-block;
      margin-top: 20px;
      color: #007bff;
      text-decoration: none;
    }

    .back-link:hover {
      text-decoration: underline;
    }
  </style>
</head>
<body>
  <div class="header">
    <h1>信用卡申请</h1>
  </div>

  <div class="container">
    <div class="form-container">
      <form action="/card/insertcard" method="post">

        <input type="hidden" name="cardType" value="1">
        <input type="hidden" name="userId" th:value="${session.user.id}">
        <input type="hidden" name="statusId" value="4">

        <div class="form-group">
          <label for="balance">申请金额:</label>
          <input type="text" id="balance" name="total" placeholder="不超过20万" required>
        </div>
        
        <div class="form-group">
          <label for="password">设置密码：</label>
          <input type="password" id="password" name="password" required>
        </div>
        
        <div class="form-group">
          <label for="remPassword">确认密码：</label>
          <input type="password" id="remPassword" name="remPassword" required>
        </div>
        
<!--        <div class="form-group">-->
<!--          <label for="phone">联系电话:</label>-->
<!--          <input type="tel" id="phone" name="phone" required>-->
<!--        </div>-->

<!--        <div class="form-group">-->
<!--          <label for="card_type">信用卡类型:</label>-->
<!--          <select id="card_type" name="card_type" required>-->
<!--            <option value="">请选择</option>-->
<!--            <option value="savings">储蓄卡</option>-->
<!--            <option value="debit">借记卡</option>-->
<!--            <option value="credit">信用卡</option>-->
<!--          </select>-->
<!--        </div>-->
        <div style="color: red; text-align: center" th:text="${session.msg}"></div>
        <button type="submit" class="button">提交申请</button>
      </form>
      <a href="/finance" class="back-link">返回</a>
    </div>
  </div>
</body>
</html>